﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WsdShop.Model.ViewModels
{
    public class V_ActivityTeam : Model.ActivityTeam
    {
        /// <summary>
        /// 团员列表
        /// </summary>
        public List<ActivityTeamMembers> ActivityTeamMembers { get; set; }



        /// <summary>
        /// 封面图
        /// </summary>
        public string CoverImg { get; set; }

        /// <summary>
        /// 该活动每个人可参与次数
        /// </summary>
        public int IsParticipateNum { get; set; }

        /// <summary>
        /// 团状态
        /// </summary>
        public int State
        {
            get
            {
                var s = TeamStatus;
                if (TeamStatus == 1)
                {
                    if (DateTime.Now > EndTime)
                    {
                        s = 3;
                    }
                }
                return s;
            }
        }


        /// <summary>
        /// 团状态(中文)
        /// </summary>
        public string StateText
        {
            get
            {
                var t = "";
                switch (State)
                {
                    case 1:t = "组团中"; break;
                    case 2: t = "组团成功"; break;
                    case 3: t = "组团失败"; break;
                    case 4: t = "已退款"; break;
                }
                return t;
            }
        }
    }
}
